package com.ts.api.common.entity;

import com.gitee.apanlh.util.base.MapUtils;
import lombok.Data;

import java.util.Map;

/**
 *  API参数对象
 *
 *  @author Pan
 */
@Data
public class ApiParameter {

    /** 拓展字段 */
    private Map<String, Object> extendField;

    public ApiParameter() {
        super();
        this.extendField = MapUtils.newHashMap();
    }

    public <T> T get(String key) {
        Object obj = extendField.get(key);
        if (obj == null) {
            return null;
        }
        return (T) obj;
    }

    public <T> T put(String key, T value) {
        extendField.put(key, value);
        return value;
    }

    /**
     *  创建
     *
     *  @return ApiParameter
     */
    public static ApiParameter create() {
        return new ApiParameter();
    }


}
